<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    let students=[
      {name:'小红',sex:'女'},
       { name: '小明', sex: '男' }
    ]
    //通过这个方法可以拿到索引和元素
    for(let[i,e] of students.entries()){
      //  console.log(i)
      //  console.log(e)
      console.log(e.name)
    }

  
  </script>
</body>
</html>